﻿using System;
using System.Collections.Generic;
using Model;
namespace BLL
{
    #region class Bcity
    /// <summary>
    /// Interface:city Interface
    /// Author:wxc
    /// DateTime:2021/5/29 14:20:36
    /// </summary>	
    public class Bcity
    {
        #region Add Method
        /// <summary>
        /// Insert an item
        /// </summary>
        /// <param name="city"></param>
        /// <returns>count of rows affected</returns>
        public int Addcity(cityEntity city)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.Addcity(city);
        }
        #endregion
        #region Mod Method
        /// <summary>
        /// Update an item
        /// </summary>
        /// <param name="city"></param>
        /// <returns>count of rows affected</returns>
        public int Modcity(cityEntity city)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.Modcity(city);
        }
        #endregion
        #region Del Method
        /// <summary>
        /// Del an item by primary key
        /// </summary>
        /// <param name="id"></param> 
        /// <returns>count of rows affected</returns>
        public int Delcity(int id)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.Delcity(id);
        }
        #endregion
        #region Select Method
        /// <summary>
        /// Select an item by Primarykey
        /// </summary>
        /// <param name="id"></param>
        /// <returns>an item</returns>
        public cityEntity Getcity(int id)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.Getcity(id);
        }
        #endregion
        #region Select_All Method
        /// <summary>
        /// Select all items
        /// </summary>
        /// <returns>items</returns>
        public IList<cityEntity> Getcitys()
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.Getcitys();
        }
        #endregion
        #region public common select by conditions ,we can use it by changing the GetcitysbyCondition(datatype condition) and sql
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<cityEntity> GetcitysbyCondition(string sql)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.GetcitysbyCondition(sql);
        }
        #endregion
        #region Select items Top n
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<cityEntity> GetcitysTopN(int n)
        {
            DAL.DALcity dal = new DAL.DALcity();
            return dal.GetcitysTopN(n);
        }
        #endregion
    }
    #endregion
}
